#define DEBUG
#include <cstdio>
#include <cstdlib>
#include <ctime>

using namespace std;

void makeData(int maxn, int maxs) {
	FILE *f = fopen("a.in", "r");
	int n=maxn;
	fprintf(f, "%d\n", n);
	for (int i=1; i<=n; i++) {
		fprintf(f, "%d ", rand()%(maxs+1));
	}
	fclose(f);
}

int main() {
	srand(time(0));

	int maxn, maxs, times;
	printf("maxn, maxs, times:");
	scanf("%d %d %d", &maxn, &maxs, &times);

	for (int i=1; i<=times; i++) {
		makeData(maxn, maxs);
		if (system("./0")) {
			printf("RE\n");
			return -1;
		}
		if (system("./0_check")) {
			printf("Checker Error\n");
			return -1;
		}
		if (system("cmp a.out a_check.out")) {
			printf("WA\n");
			return -1;
		}
	}

	return 0;
}
